#ifndef _YEP_ENGINE_KEYBOARD_EVENT_HPP
#define _YEP_ENGINE_KEYBOARD_EVENT_HPP

#include "../common.hpp"
#include "SystemEvent.hpp"

namespace yep
{
/**
 * @brief Handle a keyboard Event.
 **/
class KeyboardEvent: public SystemEvent
{
public:
    /**
     * @brief Constructor
     **/
    KeyboardEvent( Game &game, Scene2d &scene, const SDL_keysym &keysym_ ):
        SystemEvent( game, scene ), keysym( keysym_ ) {}

    /**
     * @brief Destructor
     **/
    virtual ~KeyboardEvent() {}

    /**
     * @brief Returns the keysym
     **/
    SDL_keysym getKeysym() const {
        return keysym;
    }

    SDLKey getKey() const {
        return keysym.sym;
    }

    bool getPressed() const
    {
    	return pressed;
    }

	SDL_Event getEvent() const
	{
		SDL_Event ev;
		ev.key = (SDL_KeyboardEvent) {(Uint8)(pressed?SDL_KEYDOWN:SDL_KEYUP), 0, (Uint8)(pressed?SDL_PRESSED:SDL_RELEASED), keysym};
		return ev;
	}

private:
    SDL_keysym keysym;
    bool pressed;
};

}

#endif // _YEP_ENGINE_KEYBOARD_EVENT_HPP

